function creditFormat(){
	 $("input[name=creditCode]").bind('click',function(){
	        $("#creditCodeids").val('');
			$("#creditFormatInput").dialog({
						resizable : false,
						height : 400,
						width : 600,
						modal : true,
						buttons : {
							"确定" : function() {
								 var tt = $("#creditCodeids").val().split(/\n/g).length;
								 if(tt>100){
								 	art.dialog({title: '处理结果', content: '每次最多输入100条！', ok: function () {return true; }, lock:true, background:'#600', opacity: 0.10});
								 	$("#creditCodeids").val('');
								 }else{
								 $("input[name=creditCode]").val($("#creditCodeids").val().replace(/\n/g,','));
								 $(this).dialog("close");
								 }
							},
							"取消" : function() {
								$(this).dialog("close");
							}
						}
					});
				});
		}
	function transferIdFormat(){
	 $("input[name=transferId]").bind('click',function(){
	        $("#creditCodeids").val('');
			$("#creditFormatInput").dialog({
						resizable : false,
						height : 400,
						width : 600,
						modal : true,
						buttons : {
							"确定" : function() {
								 var tt = $("#creditCodeids").val().split(/\n/g).length;
								 if(tt>100){
								 	art.dialog({title: '处理结果', content: '每次最多输入100条！', ok: function () {return true; }, lock:true, background:'#600', opacity: 0.10});
								 	$("#creditCodeids").val('');
								 }else{
								 $("input[name=transferId]").val($("#creditCodeids").val().replace(/\n/g,','));
								 $(this).dialog("close");
								 }
							},
							"取消" : function() {
								$(this).dialog("close");
							}
						}
					});
				});
		}
	
		//导出贷款信息exportForm
	function exportRedemption(){
	
	    var cooperorgCode = $("#cooperorgCode").val();
	    var agreementCode = $("#agreementCode").val();
	    var contractCode = $("#contractCode").val();
	    var packageNum = $("input[name=packageNum]").val();
		var transferId = $("input[name=transferId]").val();
		var creditCode = $("input[name=creditCode]").val();
		var redemptionDate = $("input[name=redemptionDate]").val();
		if(cooperorgCode==""){
			alert("请选择合作机构！");
			return;
		}
		if(transferId==""&&creditCode==""){
			alert("请填写债权编号或转让编号！");
			return;
		}
		if(redemptionDate==""){
			alert("请填写赎回日期！");
			return;
		}

	var dataUrl = contextRootPath
				+ '/creditRedem/exportCreditDetail?transferId='
				+ transferId + "&creditCode=" + creditCode + "&packageNum="
				+ packageNum + "&cooperorgCode=" + cooperorgCode
				+ "&contractCode=" + contractCode + "&agreementCode="
				+ agreementCode + "&redemptionDate=" + redemptionDate;
		window.location = dataUrl;

	}
	/**
	 * 按照查询条件全部赎回
	 */
	function redemptionAll(){
		if(confirm("您确认要按照查询条件全部赎回吗？")){
		
		var cooperorgCode = $("#cooperorgCode").val();
	    var agreementCode = $("#agreementCode").val();
	    var contractCode = $("#contractCode").val();
	    var packageNum = $("input[name=packageNum]").val();
		var transferId = $("input[name=transferId]").val();
		var creditCode = $("input[name=creditCode]").val();
		var redemptionDate = $("input[name=redemptionDate]").val();
		
		if(cooperorgCode==""){
			alert("请选择合作机构！");
			return;
		}
		if(transferId==""&&creditCode==""){
			alert("请填写债权编号或转让编号！");
			return;
		}
		if(redemptionDate==""){
			alert("请填写赎回日期！");
			return;
		}
		
		var params=$(".searchFrom").serialize();
		var url=contextRootPath+'/creditRedem/redemptionAll';
		//通过ajax保存
		jyAjax(
			url,
			params,
			function(msg){
				//保存成功后，执行查询页面查询方法
				alert(msg.msg);
	        	var v_status = msg.status;
	        	if(v_status.indexOf('ok') >-1){
	        		queryData();
	        	}
	  	});
		
		}
	}